#ifndef MYBUTTON_H
#define MYBUTTON_H

#include <QWidget>
#include<QPushButton>
#include <QDebug>
class MyButton2 : public QPushButton
{
    Q_OBJECT
public:
    explicit MyButton2(QWidget *parent = nullptr);
    void setpicture(QString enter, QString normal,QString chick);
    inline void setflag(bool p){
        this->flag=p;
    }
protected:
    void enterEvent(QEvent*ev);
    void leaveEvent(QEvent *ev);
    void keyPressEvent(QKeyEvent *ev);
    void paintEvent(QPaintEvent *event);
signals:
private:
    QString m_enter;
    QString m_normal;
    QString m_chick;
    QPixmap pictureshow;
    bool flag;
};
#endif // MYBUTTON_H
